package org.shiwen;



//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
    public static void main(String[] args) {
        Order orders[] = new Order[10];

        for (Order order : orders) {
            if (order != null) { //先判断存不存在订单
                if (order.isValid()) { //再判断这个订单是否有效
                    if (order.isPaid()) { //最后判断订单是否支付
                        process(order); //执行发货程序
                    }
                }
            }
        }

        for (Order order : orders) {
            if (order == null) break; // 数据不合法，结束处理

            if (!order.isValid() || !order.isPaid()) {
                continue; // 这一单跳过
            }
            process(order);
        }

        String[] names = new String[10];


        for (String name : names) {
            if (name == null || name.isEmpty()) {
                continue; // 遇到无效数据，跳过
            }
            System.out.println("有效用户：" + name);
        }

        for (int i = 0; i < 5; i++) {
            for (int j = 0; j < 5; j++) {
                if (j == i) {
                    continue; // 内层跳过这一轮
                }
                System.out.println(i + " , " + j);
            }
        }
        Order data =new Order();


        for (int i = 0; i < data.size(); i++) {
            if (!needProcess(i)) {
                continue; // 无需处理的情况直接跳过
            }
            heavyOperation(i); // 高耗时逻辑
        }
    }

    private static void heavyOperation(int i) {
    }

    private static boolean needProcess(int i) {
        return false;
    }


    private static void process(Order order) {
    }
}

class Order{

    public boolean isValid() {
        return false;
    }

    public boolean isPaid() {
        return false;
    }
    
    public int size(){
        return 10;
    }
}